package com.qiy.springcloud.alibaba.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author sehuaqi
 * @date 2020年04月12日
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * RestTemplate结合Ribbon做负载均衡一定要加 @LoadBalanced
     */
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}